import { View } from "../../../mvc/core/View";
import { Language } from "../../../../extend/language/Language";
import { RolePlayer } from "../../scene/player/entity/RolePlayer";
import { Cache } from "../../cache/Cache";
import { DataEvent } from "../../events/DataEvent";
import { WardrobeType } from "../wardrobe/WardrobeType";
import { EDressPos } from "../../../../Message/Public/EDressPos";
import { WardrobeItemInfo } from "../wardrobe/WardrobeItemInfo";
import { EEntityAttribute } from "../../../../Message/Public/EEntityAttribute";
import { SecondCareerConfig } from "../../resource/SecondCareerConfig";
import { ECareerSecondTran } from "../../../../Message/Public/ECareerSecondTran";
import { WardrobeState } from "../wardrobe/WardrobeState";
import { PlayerEqStrengthInfo } from "../player/equip/PlayerEqStrengthInfo";
import { Alert } from "../../../../com/mui/controls/Alert";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { EventName } from "../../mvc/EventName";
import { PulseSharedObject } from "../player/PulseSharedObject";
import { MsgManager } from "../../manager/MsgManager";
import { DateParser } from "../../../common/tools/DateParser";
import { EPlayerItemPosType } from "../../../../Message/Public/EPlayerItemPosType";
import { GameConst } from "../../../component/gconst/GameConst";
import { CheckBoxWin } from "../common/alertwins/CheckBoxWin";
import { StatueUserPlayer } from "../../scene/player/entity/StatueUserPlayer";
import { DirectionType } from "../../scene/modle/data/DirectionType";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../resource/ImagesConst";
import { ObjCreate } from "../common/ObjCreate";
import { ResFileConst } from "../../resource/ResFileConst";
import { MergeLevelBtn } from "../wardrobe/MergeLevelBtn";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { LoaderHelp } from "../../../common/display/LoaderHelp";
import { FashionBoxItemList } from "./FashionBoxItemList";
import { GImageButtonTabBar } from "../../../../com/mui/controls/GImageButtonTabBar";
import { GBoxDirection } from "../../../../com/mui/containers/globalVariable/GBoxDirection";
import { FilterConst } from "../../../component/gconst/FilterConst";
import { MuiEvent } from "../../../../com/mui/events/MuiEvent";
import { GTextBar } from "../range/GTextBar";
import { ActionType } from "../../scene/modle/data/ActionType";
import { ShopRule } from "../../rules/ShopRule";
import { WardrobeDeleteWindow } from "../wardrobe/WardrobeDeleteWindow";
import { ClockManager } from "../../manager/ClockManager";
import { GButton } from "../../../../com/mui/controls/GButton";
import { GLoadedButton } from "../../../../com/mui/controls/GLoadedButton";
import { GTextFiled } from "../../../../com/mui/controls/GTextFiled";
import { GCheckBox } from "../../../../com/mui/controls/GCheckBox";
import { GTabBar } from "../../../../com/mui/controls/GTabBar";
import { _type } from "../../../../this/_type";
import { _EPlayerItemPosTypeWardrobe } from "../../../../EPlayerItemPosType/_EPlayerItemPosTypeWardrobe";
import { _fashionTab } from "../../../../this/_fashionTab";
import { _wingTab } from "../../../../this/_wingTab";
type int = number;
//class FashionBoxFashionPanel
    
    export  class FashionBoxFashionPanel extends View
    {
        constructor()
        {
            super();
            this.rtnArray = [];
            this._fashionTab = Language.getArray(36141);
            this._wingTab = Language.getArray(36142);
            this._camp = RolePlayer.instance.camp;
            this._sex = Cache.instance.role.entityInfo.sex;
            this._career = RolePlayer.instance.career;
            this._equipsDic = new Map<any, any> /* flash.utils.Dictionary */();
            this.init();
            return;
        }

        public updateMergeLevelBtn(): void
        {
            this._mergeLevelBtn.updateTips(this._type);
            return;
        }

        public updateCurPicTab(): void
        {
            this.updateWardrobeList(this._tabPicBar.selectedIndex + 1);
            this._sex = Cache.instance.role.entityInfo.sex;
            return;
        }

        public dressUpdate(arg1: Boolean=false): void
        {
            this._effectTxt.text = "";
            this._isDressOp = false;
            this._equipsDic = this.getSelfEquips();
            if (arg1) 
            {
                this._wingUpperEffCb.selected = false;
            }
            this._sex = Cache.instance.role.entityInfo.sex;
            this.addUserModel(this._camp, this._sex, this._career, this._equipsDic, this._weaponStPerLv, this._wingStLv);
            return;
        }

        /* internal  */onWardrobeItemSelectedHandler(arg1: DataEvent): void
        {
            var loc2=0;
            var loc3=0;
            var loc4=null;
            var loc5=0;
            this._equipsDic = this.getSelfEquips();
            var loc1=Cache.instance.pack.rolePackCache.getAllItems();
            if (this._type != WardrobeType.WardrobeWing) 
            {
                if (this._type != WardrobeType.WardrobeFashion) 
                {
                    if (this._type != WardrobeType.WardrobeFashionWeapon) 
                    {
                        if (this._type != WardrobeType.WardrobeFootPrint) 
                        {
                            if (this._type != WardrobeType.WardrobeBubble) 
                            {
                                if (this._type != WardrobeType.WardrobeSurroung) 
                                {
                                    if (this._type != WardrobeType.WardrobeWaistBelt) 
                                    {
                                        if (this._type == WardrobeType.WardrobeElf) 
                                        {
                                            if (loc4 = loc1[(EDressPos._EDressPosElf - 1)]) 
                                            {
                                                loc2 = loc4.itemExInfo.ELFModel;
                                                loc3 = loc4.itemExInfo.bELFModel;
                                            }
                                        }
                                    }
                                    else if (loc4 = loc1[(EDressPos._EDressPosWaistBelt - 1)]) 
                                    {
                                        loc2 = loc4.itemExInfo.WBModel;
                                        loc3 = loc4.itemExInfo.bWBModel;
                                    }
                                }
                                else if (loc4 = loc1[(EDressPos._EDressPosSurround - 1)]) 
                                {
                                    loc2 = loc4.itemExInfo.SUModel;
                                    loc3 = loc4.itemExInfo.bSUModel;
                                }
                            }
                            else if (loc4 = loc1[(EDressPos._EDressPosBubble - 1)]) 
                            {
                                loc2 = loc4.itemExInfo.bubbleModel;
                                loc3 = loc4.itemExInfo.bbubbleModel;
                            }
                        }
                        else if (loc4 = loc1[(EDressPos._EDressPosFootPrint - 1)]) 
                        {
                            loc2 = loc4.itemExInfo.footprintModel;
                            loc3 = loc4.itemExInfo.bFootprintModel;
                        }
                    }
                    else if (loc4 = loc1[(EDressPos._EDressPosFashionWeapon - 1)]) 
                    {
                        loc2 = loc4.itemExInfo.weaponfashionModel;
                        loc3 = loc4.itemExInfo.bWeaponFashionModel;
                    }
                }
                else if (loc4 = loc1[(EDressPos._EDressPosFashion - 1)]) 
                {
                    loc2 = loc4.itemExInfo.fashionModel;
                    loc3 = loc4.itemExInfo.bFashionModel;
                }
            }
            else if (loc4 = loc1[(EDressPos._EDressPosWing - 1)]) 
            {
                loc2 = loc4.itemExInfo.windModel;
                loc3 = loc4.itemExInfo.bWindModel;
            }
            this._wardrobeItemInfo = arg1.data as WardrobeItemInfo;
            this._effectTxt.text = "";
            if (this._wardrobeItemInfo == null) 
            {
                return;
            }
            if (this._type != WardrobeType.WardrobeFashion) 
            {
                if (this._type != WardrobeType.WardrobeWing) 
                {
                    if (this._type != WardrobeType.WardrobeFashionWeapon) 
                    {
                        if (this._type != WardrobeType.WardrobeFootPrint) 
                        {
                            if (this._type != WardrobeType.WardrobeBubble) 
                            {
                                if (this._type != WardrobeType.WardrobeSurroung) 
                                {
                                    if (this._type != WardrobeType.WardrobeWaistBelt) 
                                    {
                                        if (this._type == WardrobeType.WardrobeElf) 
                                        {
                                            if (this._wardrobeItemInfo.itemData && this._wardrobeItemInfo.itemData.itemExInfo) 
                                            {
                                                this._equipsDic[EEntityAttribute._EAttributeElf] = this._wardrobeItemInfo.itemData.itemExInfo.ELFModel;
                                            }
                                            else 
                                            {
                                                this._equipsDic[EEntityAttribute._EAttributeElf] = this._wardrobeItemInfo.code;
                                            }
                                        }
                                    }
                                    else if (this._wardrobeItemInfo.itemData && this._wardrobeItemInfo.itemData.itemExInfo) 
                                    {
                                        this._equipsDic[EEntityAttribute._EAttributeWaistBelt] = this._wardrobeItemInfo.itemData.itemExInfo.WBModel;
                                    }
                                    else 
                                    {
                                        this._equipsDic[EEntityAttribute._EAttributeWaistBelt] = this._wardrobeItemInfo.code;
                                    }
                                }
                                else if (this._wardrobeItemInfo.itemData && this._wardrobeItemInfo.itemData.itemExInfo) 
                                {
                                    this._equipsDic[EEntityAttribute._EAttributeSurround] = this._wardrobeItemInfo.itemData.itemExInfo.SUModel;
                                }
                                else 
                                {
                                    this._equipsDic[EEntityAttribute._EAttributeSurround] = this._wardrobeItemInfo.code;
                                }
                            }
                            else if (this._wardrobeItemInfo.itemData && this._wardrobeItemInfo.itemData.itemExInfo) 
                            {
                                this._equipsDic[EEntityAttribute._EAttributeBubble] = this._wardrobeItemInfo.itemData.itemExInfo.bubbleModel;
                            }
                            else 
                            {
                                this._equipsDic[EEntityAttribute._EAttributeBubble] = this._wardrobeItemInfo.code;
                            }
                        }
                        else if (this._wardrobeItemInfo.itemData && this._wardrobeItemInfo.itemData.itemExInfo) 
                        {
                            this._equipsDic[EEntityAttribute._EAttributeFootprint] = this._wardrobeItemInfo.itemData.itemExInfo.footprintModel;
                        }
                        else 
                        {
                            this._equipsDic[EEntityAttribute._EAttributeFootprint] = this._wardrobeItemInfo.code;
                        }
                    }
                    else if (this._wardrobeItemInfo.itemData) 
                    {
                        if (Cache.instance.role.careerSecond != Cache.instance.role.careerEnabled) 
                        {
                            if (this._wardrobeItemInfo.itemData.itemExInfo) 
                            {
                                this._equipsDic[EEntityAttribute._EAttributeWeapon] = this._wardrobeItemInfo.itemData.itemExInfo.weaponfashionModel;
                            }
                            else 
                            {
                                this._equipsDic[EEntityAttribute._EAttributeWeapon] = this._wardrobeItemInfo.code;
                            }
                        }
                        else 
                        {
                            loc5 = SecondCareerConfig.instance.getSecondCode(ECareerSecondTran._ECareerSecondEquip, this._wardrobeItemInfo.itemData.itemCode, Cache.instance.role.careerBasic, Cache.instance.role.careerSecond);
                            this._equipsDic[EEntityAttribute._EAttributeWeapon] = loc5;
                        }
                    }
                    else 
                    {
                        this._equipsDic[EEntityAttribute._EAttributeWeapon] = this._wardrobeItemInfo.code;
                    }
                }
                else 
                {
                    if (this._wardrobeItemInfo.state != WardrobeState.HadEquip) 
                    {
                        this._wingStLv = 0;
                    }
                    else 
                    {
                        this._wingStLv = PlayerEqStrengthInfo.getStrengthen(this._wardrobeItemInfo.itemData);
                    }
                    if (this._wardrobeItemInfo.itemData && this._wardrobeItemInfo.itemData.itemExInfo) 
                    {
                        this._equipsDic[EEntityAttribute._EAttributeWing] = this._wardrobeItemInfo.itemData.itemExInfo.windModel;
                    }
                    else 
                    {
                        this._equipsDic[EEntityAttribute._EAttributeWing] = this._wardrobeItemInfo.code;
                    }
                    if (this._wardrobeItemInfo && this._wardrobeItemInfo.state == WardrobeState.HadEquip) 
                    {
                        this._changeModelBtn.visible = true;
                    }
                    else 
                    {
                        this._changeModelBtn.visible = false;
                    }
                }
            }
            else if (this._wardrobeItemInfo.itemData && this._wardrobeItemInfo.itemData.itemExInfo) 
            {
                this._equipsDic[EEntityAttribute._EAttributeClothes] = this._wardrobeItemInfo.itemData.itemExInfo.fashionModel;
            }
            else 
            {
                this._equipsDic[EEntityAttribute._EAttributeClothes] = this._wardrobeItemInfo.code;
            }
            this._sex = Cache.instance.role.entityInfo.sex;
            this.addUserModel(this._camp, this._sex, this._career, this._equipsDic, this._weaponStPerLv, this._wingStLv);
            this.setEffectDt(this._wardrobeItemInfo);
            if (this._wardrobeItemInfo.state != WardrobeState.HadEquip) 
            {
                this._dressBtn.label = Language.getString(36133);
                this._dressBtn.name = "dress";
            }
            else 
            {
                this._dressBtn.label = Language.getString(36143);
                this._dressBtn.name = "undress";
            }
            if (!(this._wardrobeItemInfo.state == WardrobeState.HadMix) && !(this._wardrobeItemInfo.state == WardrobeState.NoActive)) 
            {
                this._deleteBtn.visible = true;
                this._takeOutBtn.visible = true;
            }
            else 
            {
                this._deleteBtn.visible = false;
                this._takeOutBtn.visible = false;
                if (loc4 && int(loc2) == this._wardrobeItemInfo.code && !(int(loc2) == int(loc3))) 
                {
                    this._dressBtn.label = Language.getString(36144);
                    this._dressBtn.name = "undress";
                }
                else if (this._wardrobeItemInfo.state == WardrobeState.HadMix) 
                {
                    this._dressBtn.label = Language.getString(36145);
                    this._dressBtn.name = "dress";
                }
            }
            return;
        }

        /* internal  */onRemoveedToStageHandler(arg1: Object /* flash.events.Event */): void
        {
            if (this._userModel) 
            {
                this._userModel.dispose(false);
            }
            return;
        }

        /* internal  */onAlertCloseHandler(arg1: int, arg2: Boolean): void
        {
            if (Alert.OK == arg1) 
            {
                this._isDressOp = true;
                Dispatcher.dispatchEvent(new DataEvent(EventName.WardrobeChangeWingModel, {"code": this._wardrobeItemInfo.code, "type": _type}));
            }
            if (arg2) 
            {
                PulseSharedObject.save("WardrobeChangeTips", true);
            }
            return;
        }

        /* internal  */getChangeShapeTip(arg1: int, arg2: Boolean): string
        {
            var loc1="";
            if (arg1 != WardrobeType.WardrobeWing) 
            {
                if (arg1 != WardrobeType.WardrobeFashion) 
                {
                    if (arg1 != WardrobeType.WardrobeFashionWeapon) 
                    {
                        if (arg1 != WardrobeType.WardrobeFootPrint) 
                        {
                            if (arg1 != WardrobeType.WardrobeBubble) 
                            {
                                if (arg1 != WardrobeType.WardrobeSurroung) 
                                {
                                    if (arg1 != WardrobeType.WardrobeWaistBelt) 
                                    {
                                        if (arg1 == WardrobeType.WardrobeElf) 
                                        {
                                            loc1 = Language.getString(74721);
                                        }
                                    }
                                    else 
                                    {
                                        loc1 = Language.getString(74701);
                                    }
                                }
                                else 
                                {
                                    loc1 = Language.getString(71461);
                                }
                            }
                            else 
                            {
                                loc1 = Language.getString(71444);
                            }
                        }
                        else 
                        {
                            loc1 = Language.getString(71402);
                        }
                    }
                    else 
                    {
                        loc1 = Language.getString(36202);
                    }
                }
                else 
                {
                    loc1 = Language.getString(36200);
                }
            }
            else 
            {
                loc1 = Language.getString(36201);
            }
            var loc2="";
            if (arg2) 
            {
                loc2 = Language.getStringByParam(36154, loc1);
            }
            else 
            {
                loc2 = Language.getStringByParam(36155, loc1);
            }
            return loc2;
        }

        /* internal  */onTakeOutBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=null;
            if (this._wardrobeItemInfo && this._wardrobeItemInfo.state == WardrobeState.HadEquip) 
            {
                loc1 = "";
                if (this._type != WardrobeType.WardrobeFashion) 
                {
                    if (this._type != WardrobeType.WardrobeWing) 
                    {
                        if (this._type != WardrobeType.WardrobeFashionWeapon) 
                        {
                            if (this._type != WardrobeType.WardrobeFootPrint) 
                            {
                                if (this._type != WardrobeType.WardrobeBubble) 
                                {
                                    if (this._type != WardrobeType.WardrobeSurroung) 
                                    {
                                        if (this._type != WardrobeType.WardrobeWaistBelt) 
                                        {
                                            if (this._type == WardrobeType.WardrobeElf) 
                                            {
                                                loc1 = Language.getString(74720);
                                            }
                                        }
                                        else 
                                        {
                                            loc1 = Language.getString(74710);
                                        }
                                    }
                                    else 
                                    {
                                        loc1 = Language.getString(71470);
                                    }
                                }
                                else 
                                {
                                    loc1 = Language.getString(71453);
                                }
                            }
                            else 
                            {
                                loc1 = Language.getString(71417);
                            }
                        }
                        else 
                        {
                            loc1 = Language.getString(36191);
                        }
                    }
                    else 
                    {
                        loc1 = Language.getString(36162);
                    }
                }
                else 
                {
                    loc1 = Language.getString(36161);
                }
                MsgManager.showRollTipsMsg(loc1);
                return;
            }
            if (this._wardrobeItemInfo && this._wardrobeItemInfo.itemData && this._wardrobeItemInfo.uid) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.WardrobeMoveOutOfWardrobe, this._wardrobeItemInfo.itemData));
            }
            return;
        }

        /* internal  */getSelfEquips(): Map<any, any> /* flash.utils.Dictionary */
        {
            var loc11=0;
            var loc1=new Map<any, any> /* flash.utils.Dictionary */();
            var loc2=Cache.instance.pack.rolePackCache.getAllItems();
            var loc3=loc2[(EDressPos._EDressPosFashionWeapon - 1)];
            var loc4=loc2[(EDressPos._EDressPosWeapon - 1)];
            var loc5=loc2[(EDressPos._EDressPosWing - 1)];
            var loc6=loc2[(EDressPos._EDressPosFashion - 1)];
            var loc7=loc2[(EDressPos._EDressPosClothes - 1)];
            var loc8=loc2[(EDressPos._EDressPosSurround - 1)];
            var loc9=loc2[(EDressPos._EDressPosWaistBelt - 1)];
            var loc10=loc2[(EDressPos._EDressPosElf - 1)];
            if (loc3 == null) 
            {
                if (loc4 != null) 
                {
                    loc1[EEntityAttribute._EAttributeWeapon] = loc4.data.itemCode;
                    this._weaponStPerLv = RolePlayer.instance.reserveJs.weaponStPerLv;
                }
            }
            else if (Cache.instance.role.careerSecond != Cache.instance.role.careerEnabled) 
            {
                loc1[EEntityAttribute._EAttributeWeapon] = loc3.itemExInfo.weaponfashionModel;
            }
            else 
            {
                loc11 = SecondCareerConfig.instance.getSecondCode(ECareerSecondTran._ECareerSecondEquip, loc3.itemCode, Cache.instance.role.careerBasic, Cache.instance.role.careerSecond);
                loc1[EEntityAttribute._EAttributeWeapon] = loc11;
            }
            if (loc6 == null) 
            {
                if (loc7 != null) 
                {
                    loc1[EEntityAttribute._EAttributeClothes] = loc7.data.itemCode;
                }
            }
            else 
            {
                loc1[EEntityAttribute._EAttributeClothes] = loc6.itemExInfo.fashionModel;
            }
            if (loc5 != null) 
            {
                if (loc5.itemExInfo) 
                {
                    loc1[EEntityAttribute._EAttributeWing] = loc5.itemExInfo.windModel;
                }
                else 
                {
                    loc1[EEntityAttribute._EAttributeWing] = loc5.data.itemCode;
                }
                this._wingStLv = RolePlayer.instance.reserveJs.wingStrPerLv;
            }
            if (loc8) 
            {
                if (loc8.itemExInfo) 
                {
                    loc1[EEntityAttribute._EAttributeSurround] = loc8.itemExInfo.SUModel;
                }
                else 
                {
                    loc1[EEntityAttribute._EAttributeSurround] = loc8.data.itemCode;
                }
            }
            if (loc9) 
            {
                if (loc9.itemExInfo) 
                {
                    loc1[EEntityAttribute._EAttributeWaistBelt] = loc9.itemExInfo.WBModel;
                }
                else 
                {
                    loc1[EEntityAttribute._EAttributeWaistBelt] = loc9.data.itemCode;
                }
            }
            if (loc10) 
            {
                if (loc10.itemExInfo) 
                {
                    loc1[EEntityAttribute._EAttributeElf] = loc10.itemExInfo.ELFModel;
                }
                else 
                {
                    loc1[EEntityAttribute._EAttributeElf] = loc10.data.itemCode;
                }
            }
            return loc1;
        }

        /* internal  */onAddedToStageHandler(arg1: Object /* flash.events.Event */=null): void
        {
            this._isDressOp = false;
            this._equipsDic = this.getSelfEquips();
            this._sex = Cache.instance.role.entityInfo.sex;
            this.addUserModel(this._camp, this._sex, this._career, this._equipsDic, this._weaponStPerLv, this._wingStLv);
            return;
        }

        /* internal  */setEffectDt(arg1: WardrobeItemInfo): void
        {
            var loc1=null;
            if (arg1) 
            {
                loc1 = Cache.instance.wardrobe.getEffectDate(arg1, this._type);
                if (loc1) 
                {
                    this._effectTxt.text = Language.getString(36165) + DateParser.parse(loc1, Language.getString(36166));
                }
            }
            return;
        }

        /* internal  */onDressBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc2=null;
            var loc5=null;
            var loc6=0;
            var loc7=0;
            var loc1=-1;
            var loc3="";
            if (this._wardrobeItemInfo == null) 
            {
                if (this._type != WardrobeType.WardrobeFashion) 
                {
                    if (this._type != WardrobeType.WardrobeWing) 
                    {
                        if (this._type != WardrobeType.WardrobeFootPrint) 
                        {
                            if (this._type != WardrobeType.WardrobeBubble) 
                            {
                                if (this._type != WardrobeType.WardrobeSurroung) 
                                {
                                    if (this._type != WardrobeType.WardrobeWaistBelt) 
                                    {
                                        if (this._type == WardrobeType.WardrobeElf) 
                                        {
                                            loc3 = Language.getString(74722);
                                        }
                                    }
                                    else 
                                    {
                                        loc3 = Language.getString(74712);
                                    }
                                }
                                else 
                                {
                                    loc3 = Language.getString(71472);
                                }
                            }
                            else 
                            {
                                loc3 = Language.getString(71455);
                            }
                        }
                        else 
                        {
                            loc3 = Language.getString(71413);
                        }
                    }
                    else 
                    {
                        loc3 = Language.getString(36147);
                    }
                }
                else 
                {
                    loc3 = Language.getString(36146);
                }
                MsgManager.showRollTipsMsg(loc3);
                return;
            }
            if (this._type != WardrobeType.WardrobeFashion) 
            {
                if (this._type != WardrobeType.WardrobeWing) 
                {
                    if (this._type != WardrobeType.WardrobeFashionWeapon) 
                    {
                        if (this._type != WardrobeType.WardrobeFootPrint) 
                        {
                            if (this._type != WardrobeType.WardrobeBubble) 
                            {
                                if (this._type != WardrobeType.WardrobeSurroung) 
                                {
                                    if (this._type != WardrobeType.WardrobeWaistBelt) 
                                    {
                                        if (this._type == WardrobeType.WardrobeElf) 
                                        {
                                            loc1 = EDressPos._EDressPosElf;
                                        }
                                    }
                                    else 
                                    {
                                        loc1 = EDressPos._EDressPosWaistBelt;
                                    }
                                }
                                else 
                                {
                                    loc1 = EDressPos._EDressPosSurround;
                                }
                            }
                            else 
                            {
                                loc1 = EDressPos._EDressPosBubble;
                            }
                        }
                        else 
                        {
                            loc1 = EDressPos._EDressPosFootPrint;
                        }
                    }
                    else 
                    {
                        loc1 = EDressPos._EDressPosFashionWeapon;
                    }
                }
                else 
                {
                    loc1 = EDressPos._EDressPosWing;
                }
            }
            else 
            {
                loc1 = EDressPos._EDressPosFashion;
            }
            var loc4=Cache.instance.pack.rolePackCache.getAllItems();
            if (this._type != WardrobeType.WardrobeWing) 
            {
                if (this._type != WardrobeType.WardrobeFashion) 
                {
                    if (this._type != WardrobeType.WardrobeFashionWeapon) 
                    {
                        if (this._type != WardrobeType.WardrobeFootPrint) 
                        {
                            if (this._type != WardrobeType.WardrobeBubble) 
                            {
                                if (this._type != WardrobeType.WardrobeSurroung) 
                                {
                                    if (this._type != WardrobeType.WardrobeWaistBelt) 
                                    {
                                        if (this._type == WardrobeType.WardrobeElf) 
                                        {
                                            if (loc5 = loc4[(EDressPos._EDressPosElf - 1)]) 
                                            {
                                                loc6 = loc5.itemExInfo.ELFModel;
                                                loc7 = loc5.itemExInfo.bELFModel;
                                            }
                                        }
                                    }
                                    else if (loc5 = loc4[(EDressPos._EDressPosWaistBelt - 1)]) 
                                    {
                                        loc6 = loc5.itemExInfo.WBModel;
                                        loc7 = loc5.itemExInfo.bWBModel;
                                    }
                                }
                                else if (loc5 = loc4[(EDressPos._EDressPosSurround - 1)]) 
                                {
                                    loc6 = loc5.itemExInfo.SUModel;
                                    loc7 = loc5.itemExInfo.bSUModel;
                                }
                            }
                            else if (loc5 = loc4[(EDressPos._EDressPosBubble - 1)]) 
                            {
                                loc6 = loc5.itemExInfo.bubbleModel;
                                loc7 = loc5.itemExInfo.bbubbleModel;
                            }
                        }
                        else if (loc5 = loc4[(EDressPos._EDressPosFootPrint - 1)]) 
                        {
                            loc6 = loc5.itemExInfo.footprintModel;
                            loc7 = loc5.itemExInfo.bFootprintModel;
                        }
                    }
                    else if (loc5 = loc4[(EDressPos._EDressPosFashionWeapon - 1)]) 
                    {
                        loc6 = loc5.itemExInfo.weaponfashionModel;
                        loc7 = loc5.itemExInfo.bWeaponFashionModel;
                    }
                }
                else if (loc5 = loc4[(EDressPos._EDressPosFashion - 1)]) 
                {
                    loc6 = loc5.itemExInfo.fashionModel;
                    loc7 = loc5.itemExInfo.bFashionModel;
                }
            }
            else if (loc5 = loc4[(EDressPos._EDressPosWing - 1)]) 
            {
                loc6 = loc5.itemExInfo.windModel;
                loc7 = loc5.itemExInfo.bWindModel;
            }
            if (this._dressBtn.name != "dress") 
            {
                if (this._dressBtn.name == "undress") 
                {
                    this._isDressOp = true;
                    if (loc5 && int(loc6) == this._wardrobeItemInfo.code && this._wardrobeItemInfo.state == WardrobeState.HadMix) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.WardrobeChangeWingModel, {"code": loc7, "type": _type}));
                    }
                    else if (this._wardrobeItemInfo.state != WardrobeState.HadMix) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.WardrobeUndress, {"uid": this._wardrobeItemInfo.uid, "index": loc1}));
                    }
                }
            }
            else if (this._wardrobeItemInfo.state != WardrobeState.NoActive) 
            {
                if (this._wardrobeItemInfo.state != WardrobeState.HadOverdue) 
                {
                    if (this._wardrobeItemInfo.state == WardrobeState.HadActive && this._wardrobeItemInfo.uid) 
                    {
                        this._isDressOp = true;
                        Dispatcher.dispatchEvent(new DataEvent(EventName.WardrobeDress, {"posType": _EPlayerItemPosTypeWardrobe, "uid": this._wardrobeItemInfo.uid, "index": loc1}));
                    }
                    else if (this._wardrobeItemInfo.state == WardrobeState.HadMix && this._wardrobeItemInfo.code) 
                    {
                        if (loc5 && !(int(loc6) == this._wardrobeItemInfo.code)) 
                        {
                            if (GameConst.ModelChangeNimbusCost > Cache.instance.role.roleInfo.nimbus) 
                            {
                                MsgManager.showRollTipsMsg(Language.getString(70133));
                                return;
                            }
                            if (this._changedCount >= GameConst.ModelChangeDayLimit) 
                            {
                                MsgManager.showRollTipsMsg(Language.getString(70132));
                                return;
                            }
                            if (PulseSharedObject.isTodayNotTips("WardrobeChangeTips")) 
                            {
                                this._isDressOp = true;
                                Dispatcher.dispatchEvent(new DataEvent(EventName.WardrobeChangeWingModel, {"code": this._wardrobeItemInfo.code, "type": _type}));
                            }
                            else 
                            {
                                this.updateChangeModelTime();
                                Alert.alertWinRenderer = CheckBoxWin;
                                Alert.show(Language.getStringByParam(71440, GameConst.ModelChangeDayLimit - this._changedCount, GameConst.ModelChangeNimbusCost), null, Alert.OK | Alert.CANCEL, null, this.onAlertCloseHandler);
                            }
                        }
                        else if (!loc5) 
                        {
                            if (this._type != WardrobeType.WardrobeFashion) 
                            {
                                if (this._type != WardrobeType.WardrobeWing) 
                                {
                                    if (this._type != WardrobeType.WardrobeFashionWeapon) 
                                    {
                                        if (this._type != WardrobeType.WardrobeFootPrint) 
                                        {
                                            if (this._type != WardrobeType.WardrobeBubble) 
                                            {
                                                if (this._type != WardrobeType.WardrobeSurroung) 
                                                {
                                                    if (this._type != WardrobeType.WardrobeWaistBelt) 
                                                    {
                                                        if (this._type == WardrobeType.WardrobeElf) 
                                                        {
                                                            loc3 = Language.getString(74721);
                                                        }
                                                    }
                                                    else 
                                                    {
                                                        loc3 = Language.getString(74701);
                                                    }
                                                }
                                                else 
                                                {
                                                    loc3 = Language.getString(71461);
                                                }
                                            }
                                            else 
                                            {
                                                loc3 = Language.getString(71444);
                                            }
                                        }
                                        else 
                                        {
                                            loc3 = Language.getString(71402);
                                        }
                                    }
                                    else 
                                    {
                                        loc3 = Language.getString(36202);
                                    }
                                }
                                else 
                                {
                                    loc3 = Language.getString(36201);
                                }
                            }
                            else 
                            {
                                loc3 = Language.getString(36200);
                            }
                            MsgManager.showRollTipsMsg(Language.getStringByParam(36156, loc3));
                        }
                    }
                }
                else 
                {
                    if (this._type != WardrobeType.WardrobeFashion) 
                    {
                        if (this._type != WardrobeType.WardrobeWing) 
                        {
                            if (this._type == WardrobeType.WardrobeFashionWeapon) 
                            {
                                loc3 = Language.getString(36169);
                            }
                        }
                        else 
                        {
                            loc3 = Language.getString(36153);
                        }
                    }
                    else 
                    {
                        loc3 = Language.getString(36152);
                    }
                    MsgManager.showRollTipsMsg(loc3);
                }
            }
            else 
            {
                loc2 = Cache.instance.pack.backPackCache.getItemByCode(this._wardrobeItemInfo.code);
                if (loc2) 
                {
                    if (this._type != WardrobeType.WardrobeFashion) 
                    {
                        if (this._type != WardrobeType.WardrobeWing) 
                        {
                            if (WardrobeType.WardrobeFashionWeapon) 
                            {
                                loc3 = Language.getString(36168);
                            }
                            else if (WardrobeType.WardrobeFootPrint) 
                            {
                                loc3 = Language.getString(71415);
                            }
                            else if (WardrobeType.WardrobeBubble) 
                            {
                                loc3 = Language.getString(71457);
                            }
                            else if (WardrobeType.WardrobeSurroung) 
                            {
                                loc3 = Language.getString(71474);
                            }
                            else if (WardrobeType.WardrobeWaistBelt) 
                            {
                                loc3 = Language.getString(74714);
                            }
                            else if (WardrobeType.WardrobeElf) 
                            {
                                loc3 = Language.getString(74724);
                            }
                        }
                        else 
                        {
                            loc3 = Language.getString(36151);
                        }
                    }
                    else 
                    {
                        loc3 = Language.getString(36150);
                    }
                    MsgManager.showRollTipsMsg(loc3);
                }
                else 
                {
                    if (this._type != WardrobeType.WardrobeFashion) 
                    {
                        if (this._type != WardrobeType.WardrobeWing) 
                        {
                            if (this._type != WardrobeType.WardrobeFashionWeapon) 
                            {
                                if (this._type != WardrobeType.WardrobeFootPrint) 
                                {
                                    if (this._type != WardrobeType.WardrobeBubble) 
                                    {
                                        if (this._type != WardrobeType.WardrobeSurroung) 
                                        {
                                            if (this._type != WardrobeType.WardrobeWaistBelt) 
                                            {
                                                if (this._type == WardrobeType.WardrobeElf) 
                                                {
                                                    loc3 = Language.getString(74723);
                                                }
                                            }
                                            else 
                                            {
                                                loc3 = Language.getString(74713);
                                            }
                                        }
                                        else 
                                        {
                                            loc3 = Language.getString(71473);
                                        }
                                    }
                                    else 
                                    {
                                        loc3 = Language.getString(71456);
                                    }
                                }
                                else 
                                {
                                    loc3 = Language.getString(71414);
                                }
                            }
                            else 
                            {
                                loc3 = Language.getString(36167);
                            }
                        }
                        else 
                        {
                            loc3 = Language.getString(36149);
                        }
                    }
                    else 
                    {
                        loc3 = Language.getString(36148);
                    }
                    MsgManager.showRollTipsMsg(loc3);
                }
            }
            return;
        }

        /* internal  */addUserModel(arg1: int, arg2: int, arg3: int, arg4: Map<any, any> /* flash.utils.Dictionary */, arg5: int=0, arg6: int=0): void
        {
            if (this._userModel != null) 
            {
                this._userModel.dispose(false);
            }
            else 
            {
                this._userModel = new StatueUserPlayer();
            }
            this._userModel.direction = DirectionType.South;
            this._userModel.camp = arg1;
            this._userModel.sex = arg2;
            this._userModel.career = arg3;
            this._userModel.reserveJs.weaponStPerLv = arg5;
            if (this._wingUpperEffCb.selected) 
            {
                this._userModel.reserveJs.wingStrPerLv = 6;
            }
            else 
            {
                this._userModel.reserveJs.wingStrPerLv = arg6;
            }
            this._userModel.updateEquipByDic(arg4);
            this._userModel.x = 110;
            this._userModel.y = 210;
            addChild(this._userModel);
            return;
        }

        /* internal  */onChangeModelClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            if (this._wardrobeItemInfo && (this._wardrobeItemInfo.state == WardrobeState.HadEquip || this._wardrobeItemInfo.state == WardrobeState.HadMix)) 
            {
                loc1 = Cache.instance.pack.rolePackCache.getAllItems();
                loc2 = loc1[(EDressPos._EDressPosWing - 1)];
                if ((loc3 = PlayerEqStrengthInfo.getStrengthen(loc2)) >= 6) 
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.WardrobeChangeWingShape));
                }
                else 
                {
                    MsgManager.showRollTipsMsg(Language.getString(36160));
                }
            }
            return;
        }

        /* internal  */onWingUpperEffCbChangeHandler(arg1: Object /* flash.events.Event */): void
        {
            this._sex = Cache.instance.role.entityInfo.sex;
            this.addUserModel(this._camp, this._sex, this._career, this._equipsDic, this._weaponStPerLv, this._wingStLv);
            return;
        }

        /* internal  */onListChangeHandler(arg1: Object /* flash.events.Event */): void
        {
            this._wardrobeItemInfo = this._wardrobeItemList.getFirstInfo();
            if (this._wardrobeItemInfo && !(this._wardrobeItemInfo.state == WardrobeState.NoActive)) 
            {
                this._wardrobeItemList.updateSelected(0);
                this._deleteBtn.visible = true;
                this._takeOutBtn.visible = true;
            }
            else 
            {
                this._deleteBtn.visible = false;
                this._takeOutBtn.visible = false;
            }
            if (this._wardrobeItemInfo && !(this._wardrobeItemInfo.state == WardrobeState.HadEquip)) 
            {
                this._dressBtn.label = Language.getString(36133);
                this._dressBtn.name = "dress";
            }
            else 
            {
                this._dressBtn.label = Language.getString(36143);
                this._dressBtn.name = "undress";
            }
            if (this._type == 2 && this._wardrobeItemInfo && this._wardrobeItemInfo.state == WardrobeState.HadEquip) 
            {
                this._changeModelBtn.visible = true;
            }
            else 
            {
                this._changeModelBtn.visible = false;
            }
            this.setEffectDt(this._wardrobeItemInfo);
            return;
        }

        /* internal  */onResLoaded(): void
        {
            this._bg.bitmapData = GlobalClass.getBitmapData(ImagesConst.WardrobeBg);
            this._myLookBm.bitmapData = GlobalClass.getBitmapData(ImagesConst.WardrobeMyLook);
            return;
        }

        protected tabBarChangeHandler(arg1: Object /* flash.events.Event */): void
        {
            var loc1=arg1.target.selectedIndex;
            this.updateWardrobeList(loc1 + 1);
            this.onAddedToStageHandler();
            return;
        }

        /* internal  */refreshTabData(): void
        {
            var loc1=null;
            this.rtnArray = [];
            var loc2=0;
            while (loc2 < FashionBoxFashionPanel.EQUITMENTNUM) 
            {
                loc1 = new Map<any, any> /* flash.utils.Dictionary */();
                loc1["name"] = loc2;
                loc1["label"] = loc2;
                loc1["styleName"] = "FashionTab" + loc2;
                this.rtnArray.push(loc1);
                ++loc2;
            }
            this._tabPicBar.dataProvider = this.rtnArray;
            return;
        }

        /* internal  */init(): void
        {
            ObjCreate.createBg(0, 0, 220, 412, this);
            this._bg = ObjCreate.createBitmap("", 0, 0, this);
            this._myLookBm = ObjCreate.createBitmap("", 73, 6, this);
            this._changeModelBtn = ObjCreate.createGLoadedButton(ResFileConst.Bian, 75, 35, 29, 26, this);
            this._changeModelBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onChangeModelClickHandler);
            this._changeModelBtn.visible = false;
            this._changeModelBtn.toolTipData = Language.getString(71421);
            this._mergeLevelBtn = new MergeLevelBtn();
            this._mergeLevelBtn.x = 105;
            this._mergeLevelBtn.y = 35;
            addChild(this._mergeLevelBtn);
            this._btnLeft = ObjCreate.createGLoadedButton(ResFileConst.Left, 25, 200, 49, 26, this);
            this._btnLeft.drawNow();
            this._btnRight = ObjCreate.createGLoadedButton(ResFileConst.Right, 157, 200, 49, 26, this);
            this._btnRight.drawNow();
            this._effectTxt = ObjCreate.createTextField("", 40, 225, 200, 40, this, GlobalStyle.textFormat6);
            this._wingUpperEffCb = ObjCreate.createCheckBox(Language.getString(71418), 30, 245, 200, 20, this);
            this._wingUpperEffCb.addEventListener(flash.events.Event.CHANGE, this.onWingUpperEffCbChangeHandler);
            this._wingUpperEffCb.visible = false;
            this._dressBtn = ObjCreate.createGButton(Language.getString(36133), 30, 270, 70, 25, this);
            this._dressBtn.name = "dress";
            this._dressBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onDressBtnClickHandler);
            var loc1=ObjCreate.createGButton(Language.getString(36134), 120, 270, 70, 25, this);
            loc1.addEventListener(flash.events.MouseEvent.CLICK, this.onStrengBtnClickHandler);
            var loc2=ObjCreate.createGButton(Language.getString(36135), 30, 310, 70, 25, this, "ButtonRed");
            loc2.addEventListener(flash.events.MouseEvent.CLICK, this.onShopBtnClickHandler);
            var loc3=ObjCreate.createGButton(Language.getString(36136), 120, 310, 70, 25, this, "ButtonRed");
            loc3.addEventListener(flash.events.MouseEvent.CLICK, this.onPayBtnClickHandler);
            this._todayChangeTime = ObjCreate.createTextField("222", 0, 343, 220, 20, this, GlobalStyle.textFormat5);
            var loc4;
            (loc4 = ObjCreate.createTextField("", 15, 370, 185, 40, this)).wordWrap = true;
            loc4.multiline = true;
            loc4.htmlText = Language.getString(36138);
            LoaderHelp.addResCallBack(ResFileConst.wardrobe, this.onResLoaded);
            ObjCreate.createBg(223, 0, 392, 412, this);
            this._wardrobeItemList = new FashionBoxItemList(WardrobeType.WardrobeFashion);
            this._wardrobeItemList.x = 233;
            this._wardrobeItemList.y = 7;
            this._wardrobeItemList.addEventListener(flash.events.Event.CHANGE, this.onListChangeHandler);
            addChild(this._wardrobeItemList);
            this._deleteBtn = ObjCreate.createGButton(Language.getString(36137), 488, 384, 50, 25, this);
            this._deleteBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onDeleteBtnClickHandler);
            this._deleteBtn.visible = false;
            this._takeOutBtn = ObjCreate.createGButton(Language.getString(36159), 548, 384, 50, 25, this);
            this._takeOutBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onTakeOutBtnClickHandler);
            this._takeOutBtn.visible = false;
            this._tabPicBar = new GImageButtonTabBar();
            this._tabPicBar.buttonHeight = 48;
            this._tabPicBar.buttonWidth = 77;
            this._tabPicBar.x = 616;
            this._tabPicBar.y = 2;
            this._tabPicBar.verticalGap = 2;
            this._tabPicBar.direction = GBoxDirection.VERTICAL;
            this._tabPicBar.buttonFilters = [FilterConst.glowFilter];
            this._tabPicBar.addEventListener(MuiEvent.GTABBAR_SELECTED_CHANGE, this.tabBarChangeHandler);
            this.addChild(this._tabPicBar);
            this._textBar = new GTextBar();
            this._textBar.textWidth = 56;
            this._textBar.horizontalGap = 3;
            this._textBar.x = 256;
            this._textBar.y = 350;
            this._textBar.direction = GBoxDirection.HORIZONTAL;
            this._textBar.selectedColor = 15788607;
            addChild(this._textBar);
            this._textBar.addEventListener(MuiEvent.GTABBAR_SELECTED_CHANGE, this.onTextBarSelectChangeHandler);
            this._desTx = ObjCreate.createGTextField("", 258, 385, 66, 20, this, GlobalStyle.textFormat5);
            this._desTx.htmlText = Language.getString(71127);
            this._resetModleTx = ObjCreate.createGTextField("", 176, 245, 66, 20, this, GlobalStyle.textFormat5);
            this._resetModleTx.htmlText = Language.getString(71420);
            this._resetModleTx.addEventListener(flash.events.TextEvent.LINK, this.onResetModleTxClick);
            this.refreshTabData();
            this._tabPicBar.dispatchEvent(new MuiEvent(MuiEvent.GTABBAR_SELECTED_CHANGE));
            this._tabPicBar.selectedIndex = 0;
            this.addEventListener(flash.events.Event.ADDED_TO_STAGE, this.onAddedToStageHandler);
            this.addEventListener(flash.events.Event.REMOVED_FROM_STAGE, this.onRemoveedToStageHandler);
            this.addEventListener(EventName.FashionBoxItemSelected, this.onWardrobeItemSelectedHandler);
            this._btnLeft.addEventListener(flash.events.MouseEvent.CLICK, this.onBtnLeftClick);
            this._btnRight.addEventListener(flash.events.MouseEvent.CLICK, this.onBtnRightClick);
            return;
        }

        public updateCarrer(): void
        {
            this._equipsDic = this.getSelfEquips();
            this.addUserModel(this._camp, this._sex, this._career, this._equipsDic, this._weaponStPerLv, this._wingStLv);
            return;
        }

        public updatePlayerSex(): void
        {
            this._sex = Cache.instance.role.entityInfo.sex;
            this._equipsDic = this.getSelfEquips();
            this.addUserModel(this._camp, this._sex, this._career, this._equipsDic, this._weaponStPerLv, this._wingStLv);
            return;
        }

        protected onResetModleTxClick(arg1: Object /* flash.events.TextEvent */): void
        {
            this.onAddedToStageHandler(null);
            return;
        }

        protected onBtnLeftClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (this._userModel) 
            {
                this._userModel.actionState = ActionType.Stand;
                if (this._userModel.direction > 1) 
                {
                    --this._userModel.direction;
                }
                else 
                {
                    this._userModel.direction = 8;
                }
            }
            return;
        }

        protected onBtnRightClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (this._userModel) 
            {
                this._userModel.actionState = ActionType.Stand;
                if (this._userModel.direction < 8) 
                {
                    this._userModel.direction = this._userModel.direction + 1;
                }
                else 
                {
                    this._userModel.direction = 1;
                }
            }
            return;
        }

        /* internal  */onStrengBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.Equipment_DoCast_Strengthen));
            return;
        }

        /* internal  */onShopBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.ShopMallShowToTab, ShopRule.ShopMallHot));
            return;
        }

        /* internal  */onPayBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.GotoPay));
            return;
        }

        /* internal  */onTextBarSelectChangeHandler(arg1: MuiEvent=null): void
        {
            this._deleteBtn.visible = false;
            this._takeOutBtn.visible = false;
            if (this._type != WardrobeType.WardrobeFashion) 
            {
                if (this._type != WardrobeType.WardrobeWing) 
                {
                    if (this._type != WardrobeType.WardrobeFashionWeapon) 
                    {
                        if (this._type != WardrobeType.WardrobeFootPrint) 
                        {
                            if (this._type != WardrobeType.WardrobeBubble) 
                            {
                                if (this._type != WardrobeType.WardrobeSurroung) 
                                {
                                    if (this._type != WardrobeType.WardrobeWaistBelt) 
                                    {
                                        if (this._type == WardrobeType.WardrobeElf) 
                                        {
                                            loc1 = this._textBar.selectedIndex;
                                            switch (loc1) 
                                            {
                                                case 0:
                                                {
                                                    this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getallELF());
                                                    break;
                                                }
                                                case 1:
                                                {
                                                    this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getActiveFashion(WardrobeType.WardrobeElf));
                                                    break;
                                                }
                                                case 2:
                                                {
                                                    this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getHadMixFashion(WardrobeType.WardrobeElf));
                                                    break;
                                                }
                                                case 3:
                                                {
                                                    this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getNoActiveFashion(WardrobeType.WardrobeElf));
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                    else 
                                    {
                                        loc1 = this._textBar.selectedIndex;
                                        switch (loc1) 
                                        {
                                            case 0:
                                            {
                                                this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getallWaistBelt());
                                                break;
                                            }
                                            case 1:
                                            {
                                                this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getActiveFashion(WardrobeType.WardrobeWaistBelt));
                                                break;
                                            }
                                            case 2:
                                            {
                                                this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getHadMixFashion(WardrobeType.WardrobeWaistBelt));
                                                break;
                                            }
                                            case 3:
                                            {
                                                this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getNoActiveFashion(WardrobeType.WardrobeWaistBelt));
                                                break;
                                            }
                                        }
                                    }
                                }
                                else 
                                {
                                    loc1 = this._textBar.selectedIndex;
                                    switch (loc1) 
                                    {
                                        case 0:
                                        {
                                            this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getallSurround());
                                            break;
                                        }
                                        case 1:
                                        {
                                            this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getActiveFashion(WardrobeType.WardrobeSurroung));
                                            break;
                                        }
                                        case 2:
                                        {
                                            this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getHadMixFashion(WardrobeType.WardrobeSurroung));
                                            break;
                                        }
                                        case 3:
                                        {
                                            this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getNoActiveFashion(WardrobeType.WardrobeSurroung));
                                            break;
                                        }
                                    }
                                }
                            }
                            else 
                            {
                                loc1 = this._textBar.selectedIndex;
                                switch (loc1) 
                                {
                                    case 0:
                                    {
                                        this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getallBubble());
                                        break;
                                    }
                                    case 1:
                                    {
                                        this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getActiveFashion(WardrobeType.WardrobeBubble));
                                        break;
                                    }
                                    case 2:
                                    {
                                        this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getHadMixFashion(WardrobeType.WardrobeBubble));
                                        break;
                                    }
                                    case 3:
                                    {
                                        this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getNoActiveFashion(WardrobeType.WardrobeBubble));
                                        break;
                                    }
                                }
                            }
                        }
                        else 
                        {
                            loc1 = this._textBar.selectedIndex;
                            switch (loc1) 
                            {
                                case 0:
                                {
                                    this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getallFootPrint());
                                    break;
                                }
                                case 1:
                                {
                                    this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getActiveFashion(WardrobeType.WardrobeFootPrint));
                                    break;
                                }
                                case 2:
                                {
                                    this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getHadMixFashion(WardrobeType.WardrobeFootPrint));
                                    break;
                                }
                                case 3:
                                {
                                    this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getNoActiveFashion(WardrobeType.WardrobeFootPrint));
                                    break;
                                }
                            }
                        }
                    }
                    else 
                    {
                        loc1 = this._textBar.selectedIndex;
                        switch (loc1) 
                        {
                            case 0:
                            {
                                this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getAllFashionWeapon());
                                break;
                            }
                            case 1:
                            {
                                this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getActiveFashion(WardrobeType.WardrobeFashionWeapon));
                                break;
                            }
                            case 2:
                            {
                                this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getHadMixFashion(WardrobeType.WardrobeFashionWeapon));
                                break;
                            }
                            case 3:
                            {
                                this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getOverdueFashion(WardrobeType.WardrobeFashionWeapon));
                                break;
                            }
                            case 4:
                            {
                                this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getNoActiveFashion(WardrobeType.WardrobeFashionWeapon));
                                break;
                            }
                        }
                    }
                }
                else 
                {
                    loc1 = this._textBar.selectedIndex;
                    switch (loc1) 
                    {
                        case 0:
                        {
                            this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getAllWing());
                            break;
                        }
                        case 1:
                        {
                            this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getActiveWing());
                            break;
                        }
                        case 2:
                        {
                            this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getChangeWing());
                            break;
                        }
                        case 3:
                        {
                            this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getNoActiveWing());
                            break;
                        }
                    }
                }
            }
            else 
            {
                var loc1=this._textBar.selectedIndex;
                switch (loc1) 
                {
                    case 0:
                    {
                        this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getAllFashion());
                        break;
                    }
                    case 1:
                    {
                        this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getActiveFashion(WardrobeType.WardrobeFashion));
                        break;
                    }
                    case 2:
                    {
                        this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getHadMixFashion(WardrobeType.WardrobeFashion));
                        break;
                    }
                    case 3:
                    {
                        this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getOverdueFashion(WardrobeType.WardrobeFashion));
                        break;
                    }
                    case 4:
                    {
                        this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getNoActiveFashion(WardrobeType.WardrobeFashion));
                        break;
                    }
                }
            }
            return;
        }

        /* internal  */deleteWardrobeItem(): void
        {
            if (this._wardrobeItemInfo && this._wardrobeItemInfo.uid) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.WardrobeRemove, this._wardrobeItemInfo.uid));
            }
            return;
        }

        /* internal  */onDeleteBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (this._type == WardrobeType.WardrobeFashion && PulseSharedObject.isTodayNotTips("WardrobeFashionTip") || this._type == WardrobeType.WardrobeWing && PulseSharedObject.isTodayNotTips("WardrobeWingTip") || this._type == WardrobeType.WardrobeFashionWeapon && PulseSharedObject.isTodayNotTips("WardrobeFashionWeaponTip") || this._type == WardrobeType.WardrobeFootPrint && PulseSharedObject.isTodayNotTips("WardrobeFootPrintTip") || this._type == WardrobeType.WardrobeBubble && PulseSharedObject.isTodayNotTips("WardrobeBubbleTip") || this._type == WardrobeType.WardrobeSurroung && PulseSharedObject.isTodayNotTips("WardrobeSurroundTip") || this._type == WardrobeType.WardrobeWaistBelt && PulseSharedObject.isTodayNotTips("WardrobeWaistBeltTip") || this._type == WardrobeType.WardrobeElf && PulseSharedObject.isTodayNotTips("WardrobeElfTip")) 
            {
                this.deleteWardrobeItem();
                return;
            }
            var loc1="";
            var loc2="";
            if (this._type != WardrobeType.WardrobeFashion) 
            {
                if (this._type != WardrobeType.WardrobeWing) 
                {
                    if (this._type != WardrobeType.WardrobeFashionWeapon) 
                    {
                        if (this._type != WardrobeType.WardrobeFootPrint) 
                        {
                            if (this._type != WardrobeType.WardrobeBubble) 
                            {
                                if (this._type != WardrobeType.WardrobeSurroung) 
                                {
                                    if (this._type != WardrobeType.WardrobeWaistBelt) 
                                    {
                                        if (this._type == WardrobeType.WardrobeElf) 
                                        {
                                            loc1 = "WardrobeElfTip";
                                            loc2 = Language.getString(74721);
                                        }
                                    }
                                    else 
                                    {
                                        loc1 = "WardrobeWaistBeltTip";
                                        loc2 = Language.getString(74711);
                                    }
                                }
                                else 
                                {
                                    loc1 = "WardrobeSurroundTip";
                                    loc2 = Language.getString(71471);
                                }
                            }
                            else 
                            {
                                loc1 = "WardrobeBubbleTip";
                                loc2 = Language.getString(71454);
                            }
                        }
                        else 
                        {
                            loc1 = "WardrobeFootPrintTip";
                            loc2 = Language.getString(71416);
                        }
                    }
                    else 
                    {
                        loc1 = "WardrobeFashionWeaponTip";
                        loc2 = Language.getString(36190);
                    }
                }
                else 
                {
                    loc1 = "WardrobeWingTip";
                    loc2 = Language.getString(36158);
                }
            }
            else 
            {
                loc1 = "WardrobeFashionTip";
                loc2 = Language.getString(36157);
            }
            if (this._wardrobeItemInfo && this._wardrobeItemInfo.uid) 
            {
                WardrobeDeleteWindow.instance.show();
                WardrobeDeleteWindow.instance.updateInfo(this._type, loc1, this.deleteWardrobeItem);
            }
            else 
            {
                MsgManager.showRollTipsMsg(loc2);
            }
            return;
        }

        public updateWardrobeList(arg1: int): void
        {
            this._sex = Cache.instance.role.entityInfo.sex;
            this.updateChangeModelTime();
            var loc1=[{"color": 16750899, "text": _fashionTab[0].label}, {"color": 16750899, "text": _fashionTab[1].label}, {"color": 16750899, "text": _fashionTab[2].label}, {"color": 16750899, "text": _fashionTab[3].label}, {"color": 16750899, "text": _fashionTab[4].label}];
            var loc2=[{"color": 16750899, "text": _wingTab[0].label}, {"color": 16750899, "text": _wingTab[1].label}, {"color": 16750899, "text": _wingTab[2].label}, {"color": 16750899, "text": _wingTab[3].label}];
            this._effectTxt.text = "";
            this._wingUpperEffCb.visible = false;
            this._type = arg1;
            var loc3="";
            if (this._type != WardrobeType.WardrobeFashion) 
            {
                if (this._type != WardrobeType.WardrobeWing) 
                {
                    if (this._type != WardrobeType.WardrobeFashionWeapon) 
                    {
                        if (this._type != WardrobeType.WardrobeFootPrint) 
                        {
                            if (this._type != WardrobeType.WardrobeBubble) 
                            {
                                if (this._type != WardrobeType.WardrobeSurroung) 
                                {
                                    if (this._type != WardrobeType.WardrobeWaistBelt) 
                                    {
                                        if (this._type == WardrobeType.WardrobeElf) 
                                        {
                                            loc3 = Language.getString(74729);
                                            this._textBar.dataProvider = loc2;
                                            this._textBar.x = 296;
                                            this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getallELF());
                                        }
                                    }
                                    else 
                                    {
                                        loc3 = Language.getString(74709);
                                        this._textBar.dataProvider = loc2;
                                        this._textBar.x = 296;
                                        this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getallWaistBelt());
                                    }
                                }
                                else 
                                {
                                    loc3 = Language.getString(71469);
                                    this._textBar.dataProvider = loc2;
                                    this._textBar.x = 296;
                                    this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getallSurround());
                                }
                            }
                            else 
                            {
                                loc3 = Language.getString(71452);
                                this._textBar.dataProvider = loc2;
                                this._textBar.x = 296;
                                this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getallBubble());
                            }
                        }
                        else 
                        {
                            loc3 = Language.getString(71403);
                            this._textBar.dataProvider = loc2;
                            this._textBar.x = 296;
                            this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getallFootPrint());
                        }
                    }
                    else 
                    {
                        loc3 = Language.getString(36164);
                        this._textBar.dataProvider = loc1;
                        this._textBar.x = 256;
                        this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getAllFashionWeapon());
                    }
                }
                else 
                {
                    loc3 = Language.getString(36140);
                    this._textBar.dataProvider = loc2;
                    this._textBar.x = 296;
                    this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getAllWing());
                    this._wingUpperEffCb.visible = true;
                }
            }
            else 
            {
                loc3 = Language.getString(36139);
                this._textBar.dataProvider = loc1;
                this._textBar.x = 256;
                this._wardrobeItemList.updateItemData(Cache.instance.wardrobe.getAllFashion());
            }
            this._mergeLevelBtn.updateTips(arg1);
            this._textBar.selectedIndex = 0;
            this._wardrobeItemInfo = this._wardrobeItemList.getFirstInfo();
            if (this._wardrobeItemInfo && !(this._wardrobeItemInfo.state == WardrobeState.NoActive)) 
            {
                this._wardrobeItemList.updateSelected(0);
                this._deleteBtn.visible = true;
                this._takeOutBtn.visible = true;
            }
            else 
            {
                this._deleteBtn.visible = false;
                this._takeOutBtn.visible = false;
            }
            if (this._wardrobeItemInfo && !(this._wardrobeItemInfo.state == WardrobeState.HadEquip)) 
            {
                this._dressBtn.label = Language.getString(36133);
                this._dressBtn.name = "dress";
            }
            else 
            {
                this._dressBtn.label = Language.getString(36143);
                this._dressBtn.name = "undress";
            }
            if (this._type == 2 && this._wardrobeItemInfo && this._wardrobeItemInfo.state == WardrobeState.HadEquip) 
            {
                this._changeModelBtn.visible = true;
            }
            else 
            {
                this._changeModelBtn.visible = false;
            }
            this._desTx.toolTipData = loc3;
            return;
        }

        public updateChangeModelTime(): void
        {
            var loc2=null;
            var loc1=Cache.instance.wardrobe.changeModelLastTime;
            if (loc1 == "") 
            {
                this._todayChangeTime.htmlText = Language.getStringByParam(71439, -1, GameConst.ModelChangeNimbusCost);
            }
            else 
            {
                this._lastDate = DateParser.strToDateNormal(Cache.instance.wardrobe.changeModelLastTime);
                if (this._lastDate) 
                {
                    this._changedCount = Cache.instance.wardrobe.changeModelTime;
                    loc2 = ClockManager.instance.nowDate;
                    if (!(this._lastDate.getMonth() === loc2.getMonth()) || !(this._lastDate.getFullYear() === loc2.getFullYear()) || !(this._lastDate.getDate() === loc2.getDate())) 
                    {
                        this._changedCount = 0;
                    }
                    this._todayChangeTime.htmlText = Language.getStringByParam(71439, GameConst.ModelChangeDayLimit - this._changedCount, GameConst.ModelChangeNimbusCost);
                }
            }
            return;
        }

        /* internal */ static /* const */EQUITMENTNUM: int=8;

        /* internal */ /* var */_fashionTab: Array<any>;

        /* internal */ /* var */_dressBtn: GButton;

        /* internal */ /* var */_btnRight: GLoadedButton;

        /* internal */ /* var */_btnLeft: GLoadedButton;

        /* internal */ /* var */rtnArray: Array<any>;

        /* internal */ /* var */_wardrobeItemInfo: WardrobeItemInfo;

        /* internal */ /* var */_takeOutBtn: GButton;

        /* internal */ /* var */_userModel: StatueUserPlayer;

        /* internal */ /* var */_deleteBtn: GButton;

        /* internal */ /* var */_isDressOp: Boolean=false;

        /* internal */ /* var */_textBar: GTextBar;

        /* internal */ /* var */_camp: int;

        /* internal */ /* var */_sex: int;

        /* internal */ /* var */_career: int;

        /* internal */ /* var */_equipsDic: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_type: int;

        /* internal */ /* var */_wingStLv: int;

        /* internal */ /* var */_resetModleTx: GTextFiled;

        /* internal */ /* var */_desTx: GTextFiled;

        /* internal */ /* var */_wardrobeItemList: FashionBoxItemList;

        /* internal */ /* var */_wingUpperEffCb: GCheckBox;

        /* internal */ /* var */_effectTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_mergeLevelBtn: MergeLevelBtn;

        /* internal */ /* var */_tabPicBar: GTabBar;

        /* internal */ /* var */_changeModelBtn: GLoadedButton;

        /* internal */ /* var */_myLookBm: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_bg: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_lastDate: Date;

        /* internal */ /* var */_todayChangeTime: Object /* flash.text.TextField */;

        /* internal */ /* var */_changedCount: int;

        /* internal */ /* var */_wingTab: Array<any>;

        /* internal */ /* var */_weaponStPerLv: int;
    }
